import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedList;
import java.util.List;

/**
 * Created by xiebang
 * Description
 * User:小谢
 * Date:2021-09-24
 * Time:19:24
 */

class Student{
    private String name;
    private String class1;
    private double score;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getClass1() {
        return class1;
    }

    public void setClass1(String class1) {
        this.class1 = class1;
    }

    public double getScore() {
        return score;
    }

    public void setScore(double score) {
        this.score = score;
    }

    public Student(String name, String class1, double score) {
        this.name = name;
        this.class1 = class1;
        this.score = score;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", class1='" + class1 + '\'' +
                ", score=" + score +
                '}';
    }
}
public class TestDemo {
    public static void func1(String str1,String str2){
        if (str1==null || str2 == null){
            return;
        }
        List<Character> list =new ArrayList<>();
        for (int i = 0; i < str1.length(); i++) {
            char ch = str1.charAt(i);
            if (!str2.contains(ch+"")){
                list.add(ch);
            }
        }
        System.out.println(list);
        for (char ch:list
             ) {
            System.out.print(ch);

        }
    }
    public static String func(String str1,String str2){
        StringBuilder st = new StringBuilder();
        for (int i = 0; i < str1.length(); i++) {
            char ch = str1.charAt(i);
            if (!str2.contains(ch + "")){
                st.append(ch);
            }
        }
        return st.toString();
    }

    public static void main(String[] args) {
        String str1 = "welcome to bit";
        String str2 = "come";
        func1(str1,str2);

    }
    public static void main5(String[] args) {
        String str1 = "welcome to bit";
        String str2 = "come";
        String st = func(str1,str2);
        System.out.println(st);
    }
    //学习集合
    //1、构造方法
    //2、增删查改
    public static void main3(String[] args) {
        List<Student> list  = new ArrayList<>();
        Student student = new Student("写","1班",99.9);
        Student student1 = new Student("超帮","2班",199.9);
        list.add(student);
        list.add(student1);
        System.out.println(list);



    }
    public static void main1(String[] args) {
        List<Integer> list= new ArrayList<>();
        //不带参数的构造方法
        list.add(1);
        list.add(2);
        list.add(3);
        list.add(4);
        list.add(5);
//        list.add(0,99);
        System.out.println(list);


//        List<Integer> list1 = new LinkedList<>();
//        list1.add(11);
//        list1.add(12);
//        list1.addAll(list);
//        System.out.println(list1);
//        //Collection<? extends E> c 代表传过来的参数
//
//        System.out.println(list.remove(0));//传过来的是下标
//        System.out.println(list);

        System.out.println(list.get(0));
        System.out.println(list.indexOf(99));//返回该值的下标
        System.out.println(list.indexOf(299));//没有返回-1
        System.out.println(list.lastIndexOf(99));//从后开始的99的下标


    }
}
